<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>日志管理</title>
<block th:replace="commonBase"></block>   
</head>
<body>
 	  <div style="width:100%;">
        <div class="mini-toolbar" style="border-bottom:0;padding:0px;">
            <table style="width:100%;">
                <tr>
                	 <td style="width:100%;">
						   <a class="mini-button"  plain="true" iconCls="icon-edit">编辑</a>
						   <a class="mini-button"  plain="true" iconCls="icon-remove">删除</a>			  
						   <a class="mini-button"  plain="true" iconCls="icon-upload">导入</a>
						    <input id="select2" class="mini-treeselect" th:attr="url=@{/tempjson/gist/region.txt}"  multiSelect="false"  showTreeIcon="true" width="230" expandOnLoad="0"
								        textField="text" valueField="id" parentField="pid" value="110000"  
								        allowInput="true" showRadioButton="false" showFolderCheckBox="false"></input>
						    <input id="searchKey" class="mini-textbox" emptyText="请输入操作内容" style="width:250px;" onenter="search"/>   
                        	<a class="mini-button" iconCls="icon-search" onclick="search()">查询</a> 
                        	<a class="mini-button"  plain="true" iconCls="icon-redo">批量导出</a>  
                    </td>
                    <td style="white-space:nowrap;">
	                    <a class="mini-button" iconCls="fa fa-angle-double-down" onclick="expand" plain="true">高级查询</a>
	                </td>
                </tr>
            </table>           
        </div>
        <div id="p1" style="position:absolute;display:none;z-index:88;padding-left:3px;border-left:1px solid #909aa6;border-bottom:1px solid #909aa6;border-right:1px solid #909aa6;height:100px;width:calc(100% - 10px);background-color: white">
	         <div style="margin-top: 5px;">
	         	 			<input id="select2" class="mini-treeselect" th:attr="url=@{/tempjson/gist/region.txt}"  multiSelect="false"  showTreeIcon="true" width="230" expandOnLoad="0"
								        textField="text" valueField="id" parentField="pid" value="370000"  
								        allowInput="true" showRadioButton="false" showFolderCheckBox="false"></input>
						   
						     <input id="select2" class="mini-treeselect" th:attr="url=@{/tempjson/gist/region.txt}"  multiSelect="false"  showTreeIcon="true" width="230" expandOnLoad="0"
								        textField="text" valueField="id" parentField="pid" value="330000"  
								        allowInput="true" showRadioButton="false" showFolderCheckBox="false"></input>
								         <input id="searchKey" class="mini-textbox" emptyText="起点桩号" style="width:200px;" onenter="search"/>  -
								          <input id="searchKey" class="mini-textbox" emptyText="终点桩号" style="width:200px;" onenter="search"/>   
						   
							   
			</div>				    
	    </div>
    </div>
    <div class="mini-fit">
		<div id="grid1" class="mini-datagrid"
			style="width:100%;height:100%;" 
			allowCellSelect="true" multiSelect="true" allowAlternating="true" sortField="operate_date" sortOrder="desc" idField="id" pageSize="50" sizeList="[10,20,50,100]"
			 th:attr="url=@{/log/pagelist}"  >
			<div property="columns">
				<div field="operateUserId"  sortField="operate_user_id" width="100" allowSort="true">操作人</div>
				<div field="operateType" sortField="operate_type" width="100" allowSort="true" renderer="onOptRenderer">操作类型</div>
				<div field="moduleType" sortField="module_type" width="100" allowSort="true">操作对象</div>
				<div field="operateDate" width="120" dataType="date" dateFormat="yyyy-MM-dd HH:mm:ss" renderer="ondayRenderer">操作时间</div>
				<div field="content" width="500" >操作内容</div>
			</div>
		</div>
	</div>
</body>
<script th:inline="javascript" type="text/javascript">
 /*<![CDATA[*/

var grid =  null;//表格对象
$(function(){
	  mini.parse();
	  grid = mini.get("grid1");
	  grid.load();	  
});


function search(){
	var  searchKey= mini.get("searchKey").getValue();
	if(searchKey!=""){
		grid.load({"searchPhrase":searchKey});
	}else{
		grid.load();
	}

}

function expand(e) {
    var btn = e.sender;
    var display = $('#p1').css('display');
    if (display == "none") {
        btn.setIconCls("fa fa-angle-double-up");
        $('#p1').css('display', "block");
        
    } else {
        btn.setIconCls("fa fa-angle-double-down");
        $('#p1').css('display', "none");
    }
}


var openU = [{ id: 1, text: '增加' }, { id:2, text: '删除'} ,{ id:3, text: '修改'}];
function onOptRenderer(e) {
    for (var i = 0, l = openU.length; i < l; i++) {
        var g = openU[i];
        if (g.id == e.value) return g.text;
    }
    return "";
}

function ondayRenderer(e){
	//alert();
	
		var operateDate = e.value;
       	if(!operateDate){
       		return "";
       	}
        return format(operateDate, 'yyyy-MM-dd HH:mm:ss');
}

/*]]>*/
</script>
</html>